x = [-1 -1 1 1 -1 -1 1 1 -1 -1 1 1 1 -1 -1 1 1;1 -1 -1 1 1 1 1 -1 -1 1 1 1 -1 -1 -1 -1 -1;1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1] x = Columns 1 through 9 -1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 Columns 10 through 17 -1 1 1 1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 >> T = [1 0 0 3;0 1 0 4;0 0 1 5;0 0 0 1] T = 1 0 0 3 0 1 0 4 0 0 1 5 0 0 0 1 >> x = [x;ones(1,17)] x = Columns 1 through 11 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 Columns 12 through 17 1 1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 1 1 1 1 1 >> f = T * x; >> f f = Columns 1 through 11 2 2 4 4 2 2 4 4 2 2 4 5 3 3 5 5 5 5 3 3 5 5 6 6 6 6 6 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1 Columns 12 through 17 4 4 2 2 4 4 5 3 3 3 3 3 6 6 6 4 4 6 1 1 1 1 1 1 >> plot3(x(1,:),x(2,:),x(3,:) ,'g-') >> rotate3d >> hold,plot3(z(1,:),z(2,:),z(3,:) ,'r-') Current plot held Undefined variable z. >> hold,plot3(f(1,:),f(2,:),f(3,:) ,'r-') Current plot released >> plot3(x(1,:),x(2,:),x(3,:) ,'g-') >> hold,plot3(f(1,:),f(2,:),f(3,:) ,'r-') Current plot held >> rotate3d >> T1 = [1 0 0 0;0 cosd(30) -sind(30) 0;0 sind(30) cosd(30) 0;0 0 0 1] T1 = 1.0000 0 0 0 0 0.8660 -0.5000 0 0 0.5000 0.8660 0 0 0 0 1.0000 >> Tx = T1; >> Zx = Tx*x; >> plot3(x(1,:),x(2,:),x(3,:) ,'g-'); >> hold,plot3(Zx(1,:),Zx(2,:),Zx(3,:) ,'r-') Current plot held >> rotate3d